package com.example.controller;

import com.example.dto.req.ExcelReq;
import com.example.dto.req.WordReq;
import com.example.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExcelController {
    
    @Autowired
    private ExcelService excelService;
    
    @PostMapping("/excel-table-name")
    public void excelTableName(@RequestBody @Validated ExcelReq req) {
        excelService.excelTableName(req);
    }
    
    @PostMapping("/excel")
    public void excel(@RequestBody @Validated ExcelReq req) {
        excelService.excel(req);
    }
    
    @PostMapping("/word")
    public void word(@RequestBody @Validated WordReq req) {
        excelService.word(req);
    }
}
